/* eslint-disable no-console */
export class Stack<T> {
	data: T[] = []

	isEmpty(): boolean {
		return this.data.length === 0
	}

	push(x: T) {
		this.data = [x].concat(this.data)
	}

	pop(): T | undefined {
		return this.data.pop()
	}
}

const s = new Stack<number>()
console.log(s.isEmpty())
s.push(3)
s.push(2)
s.push(1)
console.log(s.data)
console.log(s.pop())
console.log(s.pop())
console.log(s.pop())
console.log(s.pop())
console.log(s.isEmpty())
